home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / crt.swg / 0008_Readkey and KEYPRESS.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-05-28  |  717 b   |  28 lines

  1. {
  2. Crt Unit, but I don't want to use the Crt.  Could some one show
  3. me a routine For Pause, or Delay With a Time Factor?
  4.  
  5.   ...I can supply you With KeyPressed and ReadKey routines For
  6.   TP6 or TP7, which could be used to create a Pause routine.
  7.   The Delay is a bit harder, I've got a routine I wrote last
  8.   year For this, but I'm still not happy With it's accuracy.
  9. }
  10.  
  11. { Read a key-press. }
  12. Function ReadKeyChar : {output} Char; Assembler;
  13. Asm
  14.   mov ah, 00h
  15.   int 16h
  16. end; { ReadKeyChar. }
  17.  
  18. { Function to indicate if a key is in the keyboard buffer. }
  19. Function KeyPressed : {output} Boolean; Assembler;
  20. Asm
  21.   mov ah, 01h
  22.   int 16h
  23.   mov ax, 00h
  24.   jz #1
  25.   inc ax
  26.   @1:
  27. end; { KeyPressed. }
  28.